<template>
    <el-drawer title="档案详情" :visible.sync="drawer" :direction="direction" :before-close="handleClose" size="50%">
        <el-descriptions class="margin-top" title="客户详情" :column="2" size="medium " border
            style="margin-left: 20px;margin-right: 20px;width:800px">
            <el-descriptions-item label="客户名称">{{ form.customerName }}</el-descriptions-item>
            <el-descriptions-item label="客户编号">{{ form.customerCode }}</el-descriptions-item>
            <el-descriptions-item label="所属小区">{{ form.customerName }}</el-descriptions-item>
            <el-descriptions-item label="身份证">{{ form.idNumber }}</el-descriptions-item>
            <el-descriptions-item label="客户地址">{{ form.customerAddress }}</el-descriptions-item>
            <el-descriptions-item label="手机号码">{{ form.telephone }}</el-descriptions-item>
            <el-descriptions-item label="账户状态">
                <el-tag size="small">{{ form.customerName }}</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="联系人">{{ form.customerName }}</el-descriptions-item>
            <el-descriptions-item label="账户余额">{{ form.remainAmout }}</el-descriptions-item>
            <el-descriptions-item label="账单日">{{ form.billDay }}</el-descriptions-item>
            <el-descriptions-item label="开户日期">{{ form.openDate }}</el-descriptions-item>
            <el-descriptions-item label="短信提醒号码">{{ form.messagePhone }}</el-descriptions-item>
            <el-descriptions-item label="欠费关阀">
                <el-tag size="small" v-if="form.isCloseOverdue == 'N'">否</el-tag>
                <el-tag size="small" v-if="form.isCloseOverdue == 'Y'">是</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="缴费开阀">
                <el-tag size="small" v-if="form.isOpenPaid == 'N'">否</el-tag>
                <el-tag size="small" v-if="form.isOpenPaid == 'Y'">是</el-tag>
            </el-descriptions-item>
            <!-- <el-descriptions-item label="充值次数">{{ form.payCount }}</el-descriptions-item> -->
            <el-descriptions-item label="累计用气量">{{ form.remainVolume }}</el-descriptions-item>
            <el-descriptions-item label="自动发送短信">
                <el-tag size="small" v-if="form.isAutoSendmsg == 'N'">否</el-tag>
                <el-tag size="small" v-if="form.isAutoSendmsg == 'Y'">是</el-tag>
            </el-descriptions-item>
        </el-descriptions>
        <el-descriptions class="margin-top" title="测试设备" :column="2" size="medium " border
            style="margin-left: 20px;margin-right: 20px;width:800px">
            <el-descriptions-item label="DTU编号">{{ form1.dtuCode }}</el-descriptions-item>
            <!-- <el-descriptions-item label="设备ID">{{ form1.deviceId }}</el-descriptions-item> -->
            <el-descriptions-item label="流量计厂家">{{ form1.flowmeterManufacturer }}</el-descriptions-item>
            <el-descriptions-item label="基表底数">{{ form1.baseNumber }}</el-descriptions-item>
            <el-descriptions-item label="报警额度">{{ form1.alarmGas }}</el-descriptions-item>
            <el-descriptions-item label="基表iccid">{{ form1.iccid }}</el-descriptions-item>
            <el-descriptions-item label="IMEI">{{ form1.imei }}</el-descriptions-item>>
            <el-descriptions-item label="流量计起始量">{{ form1.initialGas }}</el-descriptions-item>
            <el-descriptions-item label="安装日期">{{ form1.installTime }}</el-descriptions-item>
            <el-descriptions-item label="运行状态">
                <el-tag size="small" v-if="form1.meterStatus == '1'">待安装</el-tag>
                <el-tag size="small" v-if="form1.meterStatus == '2'">正常</el-tag>
                <el-tag size="small" v-if="form1.meterStatus == '3'">已拆卸</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="气表进气方向">
                <el-tag size="small" v-if="form1.intakeDirection == 'L'">左进</el-tag>
                <el-tag size="small" v-if="form1.intakeDirection == 'R'">右进</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="是否带流量计">
                <el-tag size="small" v-if="form1.isFlowmeter == 'N'">否</el-tag>
                <el-tag size="small" v-if="form1.isFlowmeter == 'Y'">是</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="是否带GPRS">
                <el-tag size="small" v-if="form1.isGprs == 'N'">否</el-tag>
                <el-tag size="small" v-if="form1.isGprs == 'Y'">是</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="阀门状态">
                <el-tag size="small" v-if="form1.meterStatus == '0'">关闭</el-tag>
                <el-tag size="small" v-if="form1.meterStatus == '1'">开启</el-tag>
                <el-tag size="small" v-if="form1.meterStatus == '2'">未知</el-tag>
            </el-descriptions-item>
            <el-descriptions-item label="通讯地址">{{ form1.mailAddress }}</el-descriptions-item>
            <el-descriptions-item label="通讯协议">{{ form1.mailProtocol }}</el-descriptions-item>
            <el-descriptions-item label="表计编码">{{ form1.meterCode }}</el-descriptions-item>
            <el-descriptions-item label="供应商">{{ form1.meterManufacturer }}</el-descriptions-item>
            <el-descriptions-item label="客户类型">{{ form1.meterModel }}</el-descriptions-item>
            <!-- <el-descriptions-item label="基表手机号">{{ form1.meterPhoneNum }}</el-descriptions-item> -->
            <el-descriptions-item label="表具类型">{{ form1.meterType }}</el-descriptions-item>
            <el-descriptions-item label="工程工料费">{{ form1.projectFee }}</el-descriptions-item>
            <el-descriptions-item label="备注">{{ form1.remark }}</el-descriptions-item>

        </el-descriptions>
    </el-drawer>
</template>
<script>
import { meterarchivesInfo, } from "@/api/fileManagement/meterarchives.js"
import { customeInfo, } from "@/api/fileManagement/civilArchives.js"

export default {
    props: ['info'],
    data() {
        return {
            drawer: true,
            direction: 'rtl',
            formArr: {},
            form: {},
            form1: {},
        }
    },
    watch: {
        info: {
            deep: true,
            handler(val) {

            },
        },
        form: {
            deep: true,
            handler(val) {
                this.form = val
            },
        },
        form1: {
            deep: true,
            handler(val) {
                this.form1 = val
            },
        }
    },
    mounted() {
        if (this.info.id) {
            customeInfo(this.info.id).then((response) => {
                this.form = response.data;
            });
            meterarchivesInfo(this.info.meterId).then((response) => {
                this.form1 = response.data;
            });
        }
    },
    methods: {
        handleClose(done) {
            done();
            this.$emit('closeDilog')
        }
    }
}
</script>
<style></style>